The present invention relates to computer modeling of geometric shapes and, in particular, to modeling NURBS surfaces.
Computer generated 3-D animations enrich a wide range of human experience, captivating audiences at the movie theaters, gluing gamers to their personal computers, and embarking home buyers on virtual tours of new homes. To generate 3-D animations, a 3-D designer creates 3-D computer models of the entities using computer aided design systems (CAD). These models are used to emulate the movement, color, and shape of animated entities, from a dancing baby to space ships trekking through the universe.
3-D models are often composed of graphical components that represent the shapes and surfaces that make up modeled objects. A graphical component is a set of data, procedures, or a combination thereof used to represent a geometry, such as curve or a surface, or a feature of the geometry, such as a curve defining a boundary of a surface.
A CAD system generates a graphical component when, for example, the system receives user input that specifies the definition of a graphical component. The CAD system generates the graphical component as specified by the user input. With earlier CAD systems, designers would determine the position of new components in relation to one or more components already in existence, and input data specifying the position. For example, a CAD system receives user input from a designer that specifies the creation of a line B, and in particular, specifies an endpoint for line B at a particular position. The user has selected the endpoint because it coincides with the endpoint of a line A. In response, the CAD system generates line B with the specified endpoint.
While the position of the endpoint of line B was captured, the intended relationship between line A and line B was not. Thus graphical components generated through earlier CAD systems are essentially independent entities, whose relationship from the perspective of the CAD system were incidental to the manner and order created, and not described to the CAD system. If line A was displaced through a revision, then line B may no longer join line A. To maintain the intended relationship between components, the designer may have to revise each of the related components.
Having to change all components in a relationship when one of those components is revised can be cumbersome, especially for more complex components such as surfaces. For example, a designer may specify a particular surface (blend surface) to provide a blend between two other surfaces (blended surfaces). In the earlier CAD systems, when the designer specified a revision to one of the blended surfaces, the designer would also have to modify the blend surface to maintain the intersection between it and the blended surfaces. In CAD systems, intersections between surfaces account for much of the complexity in the CAD system, and in particular, its user interface.
Capturing the intended relationships between graphical components is especially important to computer generated animation. Without information describing these relationships between graphical components, the computer may not automatically maintain the relationships when revising graphical components.
A solution to the problem of capturing the relationship between graphical components is relational modeling. In relational modeling, graphical components may defined in terms of other graphical components, and the types of operations needed to create the graphical components, including operations that may applied to the other graphical components.
FIG. 1 shows an example of a surface created through relational modeling, and the graphical components used to model the surface. Surface 110 is defined as a loft through a set of lines, and in particular, lines 112, 114, 116, 118, 122, and 124.
Surface component 120 is a graphical component used to model surface 110. Similarly, curve components 152, 154, 156, 158, 162, and 164 are used to model lines 112, 114, 116, 118, 122 and 124. Just as lines 112, 114, 116, 118, 122 and 124 are used to define surface 110, curve component 152, 154, 156, 158, 162, and 164 are used to define surface component 120. Surface component 120 is defined in terms graphical components used to define curves that define surface 110. These graphical components include curve components 152, 154, 156, 158, 162, and 164. Surface component 120 is also associated with operations (e.g. functions, methods) that are applied to curve components 152, 154, 156, 158, and 162 in order to, for example, recalculate data used to define a surface.
The following terms are useful to describing graphical components used in relational modeling. A xe2x80x9csurfacexe2x80x9d component is a graphical component used to model a surface. A particular graphical component is said to xe2x80x9cdependxe2x80x9d on another graphical component when the particular graphical component is defined in terms of the other graphical component. Thus surface component 120 is said to depend on curve components 152, 154, 156, 158, 162, and 164 because surface component 120 is defined by the curve components.
Graphical components are referred to as being xe2x80x9crelatedxe2x80x9d when one of the graphical components depends on the other graphical component. A graphical component that depends on another graphical component is referred to as a xe2x80x9crelationalxe2x80x9d graphical component. Thus, surface component 120 is a relational graphical component. A xe2x80x9crelational modelxe2x80x9d is set of related graphical components used to model a particular geometry. Thus, surface component 120 and curve components 152, 154, 156, 158, 162, and 164 are related, and form a relational model used to depict surface 110.
Because surface component 120 is a relational model, it may be revised through the graphical components on which it depends. Thus surface component 120 may be revised by modification to one of curves 112, 114, 116, 118, 122, and 124. After such a revision, surface 110 may be recalculated and redisplayed to fit the revised curve.
Typically, a graphical component that depends on another contains a reference to the other graphical component. A reference used to refer to another graphical component on which a particular graphical depends is referred to as a relational reference. When a graphical component in an relational model is altered, any graphical component that contains a reference to the altered graphical component may be altered, recalculated, and re-displayed. Thus, when curve component 162 is altered, surface component 120 may be altered and recalculated.
Surfaces are often modeled through a type of graphical component referred to as a Nonuniform Rational B-spline (NURBS) surface component. NURBS surface components are able to describe smooth shapes, are intuitively editable by a user, and are efficiently calculated by a computer. Surfaces described by NURBS surface components are referred to as NURBS surfaces.
However, one drawback to NURBS surface components is that they require four distinct boundaries. Thus, surface 110 may be described using a NURBS surface component because it has four distinct boundaries, lines 112, 114, 116, and 118.
FIG. 2, on the other hand, shows a surface 210, which may not be described using NURBS surface components. Surface 210 has one boundary, curve 212, not four.
One approach to overcoming the four-boundary limitation and to building non-four sided surfaces using NURBS surface components involves applying a trimming curve to the NURBS surface, where the trimming curve is defined to be on the NURBS surface. A trimming curve is a closed loop that defines a pattern on a surface. A trimmed surface is a surface that, when rendered, is xe2x80x9ctrimmedxe2x80x9d by a trimming curve. That is, either the portion of the trimmed surface that extends beyond the closed loop of the trimming curve, or the portion of the trimmed surface that resides within the closed loop, is a trimmed NURBS surface that is trimmed by a trimming curve. To model a hole in a surface, the portion on the interior trimming curve may not be rendered as part of the surface. Alternately, portions of the surface on the interior of the trimming curve may be rendered while the portion outside may not. Referring to FIG. 2, to render a surface without four boundaries using a NURBS surface, trimming curve 252 is applied to untrimmed NURBS surface 250, rendering trimmed NURBS surface 260.
Because of the benefits of relational modeling, it would be advantageous to create a relational model that includes both a related NURBS surface component and a trimming curve component. However, to use this approach gives rise to the problem of a circular definition. The problem of circular definition arises because the trimming curve is defined by the surface, and the surface is defined by the trimming curve. A given graphical component cannot be defined by another graphical component whose definition depends on the given graphical component.
Based on the foregoing, it desirable to provide a method of creating a relational model of a trimmed NURBS surface that avoids the problem of circular definition.
The foregoing needs and objects, and other needs and objects that will become apparent from the following description, are achieved by the present invention, which comprises, in one aspect, a relational model used to model a trimmed NURBS surface. The relational model may be formed of a NURBS surface object, a trimming curve object that depends on the NURBS surface object, and a third object which depends on both the NURBS surface object and trimming curve object. Modeling a NURBS surface and a trimmed NURBS surface as separate objects eliminates the issue of circular definitions discussed earlier with respect to relational modeling of trimmed NURBS surfaces.